<template>
	<view class="bg-white br-rd-10  mg-10 pd-5">
		<u-cell :border="false" size="large" @click="onClick(item)" :isLink="isLink">
			<image slot="icon" class="avatar br-rd-6" :src="item.avatar"></image>
			<view slot="title" class="title"><text class="">{{item.name}}</text><text
					class="mg-left-5 font-size-12">【{{item.agentName}}】</text>
			</view>

			<view slot="label">
				<view class="label font-size-14">
					<view> <text>{{$t('手机号')}} </text>:<text>{{item.phone}}</text> </view>
					<view> <text>{{$t('金额')}} </text>:<text class="color-price price">{{getPrice(item.balance)}}</text>
					</view>
					<view> <text>{{$t('上月输入')}}</text>:<text
							class="color-price price">{{getPrice(item.monthPrice)}}</text> </view>
					<view> <text>{{$t('我的上级')}} </text>:<text>{{item.parentName}}</text> </view>
				</view>
			</view>
		</u-cell>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object || Array,
				default: {}
			},
			isLink: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {

			}
		},
		methods: {
			onClick: function(item) {
				//console.log(item)
				this.$emit("action", item)
			},
			getPrice: function(price) {
				if (price == null) {
					return 0
				} else {
					return price;
				}
			}
		}
	}
</script>

<style>
	.avatar {
		width: 40px;
		height: 40px;
		background-color: #EEEEEE;
	}

	.title {
		text-indent: 10px;
	}

	.label {
		padding-left: 10px;
		padding-right: 10px;
		color: #BBBCC6;
	}

	.price::after {
		content: "￥  ";
	}
</style>